home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_15_1987_Transactor_Publishing.d64 / robot arm 2 (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  1KB  |  48 lines

  1. 5 rem demonstration program for robot arm
  2. 10 rem kevin o'connor april 1983
  3. 15 p=37136:rem port address
  4. 20 poke 37138,255:rem make all lines output
  5. 30 poke p,9:rem shoulder up
  6. 40 for i=1 to 15000:next i
  7. 50 poke p,21:rem wrist up
  8. 60 x=peek(36873):rem feedback for wrist
  9. 70 if x<>23 then goto 60
  10. 80 poke p,13:rem spin wrist
  11. 90 for i=1 to 10000:next i
  12. 100 poke p,2:rem rotate base cw
  13. 110 for i=1 to 15000:next i
  14. 120 poke p,6:rem elbow cw
  15. 130 x=peek(36872):rem feedback for elbow
  16. 140 if x<>48 then goto 130
  17. 150 poke p,22:rem wrist down
  18. 160 x=peek(36873)
  19. 170 if x<>77 then goto 160
  20. 180 poke p,10:rem shoulder down
  21. 190 for i=1 to 14000:next i
  22. 200 poke p,18:rem open hand
  23. 210 for i=1 to 5000:next i
  24. 220 poke p,0:rem off
  25. 230 ti$="000000" :rem 15 second wait
  26. 240 if ti$<>"000015" then goto 240
  27. 250 poke p,17:rem close hand
  28. 260 for i=1 to 5000:next i
  29. 270 poke p,9:rem shoulder up
  30. 275 for i=1 to 15000:next i
  31. 280 poke p,21:rem wrist up
  32. 290 x=peek(36873)
  33. 300 if x<>12 then goto 290
  34. 310 poke p,14:rem wrist ccw
  35. 320 for i=1 to 10000:next i
  36. 330 poke p,1:rem base ccw
  37. 340 for i=1 to 15000:next i
  38. 350 poke p,5:rem elbow ccw
  39. 360 x=peek(36872)
  40. 370 if x<>29 then goto 360
  41. 380 poke p,22:rem wrist down
  42. 390 x=peek(36873)
  43. 400 if x<>77 then goto 390
  44. 410 poke p,10:rem shoulder down
  45. 420 for i=1 to 14000:next i
  46. 430 poke p,0
  47. 440 end
  48.